<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labor_company_contracts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('admin_id')->default(0)->index();
            $table->unsignedBigInteger('company_id')->default(0)->index();
            $table->unsignedBigInteger('role_id')->default(0)->index();
            $table->unsignedBigInteger('labor_company_id')->default(0)->index();
            $table->string('name')->nullable()->comment('劳务公司名称');
            $table->string('bank')->nullable()->comment('开户银行');
            $table->string('bank_number')->nullable()->comment('银行账号');
            $table->decimal('price')->nullable()->default(0)->comment('合同金额');
            $table->date('start_date')->nullable()->comment('开工日期');
            $table->date('end_date')->nullable()->comment('竣工日期');
            $table->string('duration')->nullable()->comment('工期');
            $table->string('service_fee_ratio')->nullable()->comment('服务费比例');
            $table->string('contract_num')->nullable()->comment('合同份数');
            $table->string('contact')->nullable()->comment('劳务公司联系方式');
            $table->string('contract_type')->nullable()->comment('合同类型');
            $table->string('earnest_money')->nullable()->comment('履约保证金');
            $table->string('warranty_period')->nullable()->comment('保修期');
            $table->string('contracting_method')->nullable()->comment('承包方式');
            $table->string('payment_currency')->nullable()->comment('支付币种');
            $table->string('construction_content')->nullable()->comment('施工内容');
            $table->string('pay_method')->nullable()->comment('付款方式');
            $table->string('remarks')->nullable()->comment('备注');
            $table->string('files')->nullable()->comment('附件上传');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labor_company_contracts');
    }
};
